Skip to content

fix/compose restart policy - #23

Merged
foscomputerservices merged 10 commits into
mainfrom
fix/compose-restart-policy
Nov 1, 2026
Merged

foscomputerservices merged 10 commits into
mainfrom
fix/compose-restart-policy

Conversation

@foscomputerservices

Copy link
Copy Markdown
Owner
  • fix(deploy): restart client/server unless-stopped (10-day outage)
  • fix(security): patch SwiftNIO/Leaf advisories, nginx 1.30.6, security headers
  • ci: pin GitHub Actions to commit SHAs, add Dependabot for actions
  • fix(deploy): clear a stale Postgres lock after an unclean host reboot
  • fix(deploy): build images sequentially so the 3.9 GB VM does not OOM
  • fix(deploy): single-job Swift release builds so the 3.9 GB VM does not OOM
  • docs(runbook): add the 8 GB swapfile to in-guest provisioning
  • docs(runbook): SSH hardening must beat cloud-init's drop-in; rotate the default password

foscomputerservices and others added 10 commits August 5, 2026 08:00
Only nginx declared a restart policy, so a host reboot on 2026-07-25 left
client and server in Exited (255) permanently while nginx crash-looped
15,418 times on `host not found in upstream "server"`. Nothing bound :443
and the public site was dark for ~10.7 days.

Add `restart: unless-stopped` to both app services so Docker brings the
whole stack back after a VM reboot or docker-daemon restart.

Also correct the backup docs: fos-showcase keeps no Tart checkpoints by
design — recovery is redeploy-from-repo, and the fos-openclaw host is
covered by Time Machine. Runbook Section 7 previously instructed
installing a checkpoint LaunchAgent that was deliberately never used, and
the README rebuild step globbed it in. Section 7 now documents the actual
posture plus a regression note for this outage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X1D5cYWQ8DwwMbu2pGVZMs
… headers

Package.resolved (and the Xcode workspace lockfile) move every package with an
open 2026 advisory past its fix version: swift-nio 2.104.0, swift-nio-ssl
2.37.5, swift-nio-http2 1.46.0, swift-nio-extras 1.35.2, leaf-kit 1.14.3,
vapor 4.122.3, websocket-kit 2.16.2. FOSUtilities stays at its existing pin.

Dockerfile-nginx moves from nginx 1.28.0 to 1.30.6 (current stable).

nginx.conf adds HSTS, X-Content-Type-Options, Referrer-Policy, X-Frame-Options
and a Content-Security-Policy on 443 (self + cdn.jsdelivr.net for Bootstrap,
inline styles only, same-origin images); the 8081 API server gets the same
headers with a deny-all CSP.

Whole-package tests pass in the swift:6.2.3-noble image used for deploys.
Floating refs (@v2, @v1, @latest) let a compromised upstream action run in
CI with this repo's secrets. Each action is now pinned to the commit of its
current release: actions/checkout v7.0.1, maxim-lobanov/setup-xcode v1.7.0,
SwiftyLab/setup-swift v1.14.2. Dependabot keeps the pins fresh weekly.
On 2026-10-06 a macOS upgrade reboot killed postgres mid shutdown on
fos-openclaw and left postmaster.pid behind. The recorded PID belonged to an
unrelated process, so postgres refused to start every 10 s and the showcase
server container crash-looped on "connection refused" until the file was
removed by hand.

deploy/postgres-clear-stale-lock.sh moves the lock aside only when the PID
is not a running postgres and nothing listens on the cluster port; the
com.foscs.postgres-stale-lock LaunchAgent runs it every five minutes. Both
are installed on the host. The runbook documents the install and the manual
recovery, and uses the stable Homebrew opt path for psql.
`docker compose up -d --build` compiles both Swift apps in parallel; each
release build spawns ~1.6 GB swift-frontend processes and on 2026-11-01 the
kernel OOM-killer ended the build (and briefly sshd and DNS) on the 2 vCPU /
3.9 GB fos-showcase VM. Build server, client and nginx one at a time, then
swap the running containers with a single `up -d`.
…t OOM

Even one image at a time, a release build on the 2 vCPU / 3.9 GB fos-showcase
VM runs two swift-frontend processes of ~1.6 GB each and the kernel OOM-killer
ends the compile (signal 9, 2026-11-01). --jobs 1 keeps one frontend resident;
the build takes longer but completes.
A Swift release build on the 4 GB fos-showcase VM exceeds RAM even with
--jobs 1 (whole-module optimization), and on 2026-11-01 the OOM-killer ended
the build, sshd and DNS. The swapfile was added to the live VM the same day;
record it as provisioning step 4b so a rebuilt VM gets it too.
…he default password

The sed edit of /etc/ssh/sshd_config never took effect: Ubuntu includes
sshd_config.d/*.conf first and cloud-init's root-only 50-cloud-init.conf
sets PasswordAuthentication yes, and sshd keeps the first value. The VM was
found on 2026-11-01 with password login enabled and the base image's
documented admin/admin password unchanged (LAN-only exposure by firewall;
no failed logins in the journal). Fixed on the VM the same day: the
cloud-init drop-in removed, 00-hardening.conf with PasswordAuthentication no
and PermitRootLogin no, password rotated. The runbook now does it that way
and verifies with sshd -T.
…s-latest)

The macos-latest runner image now carries Xcode 26.0 through 26.6 only, so
maxim-lobanov/setup-xcode fails before checkout on the iOS, tvOS and watchOS
jobs (PR #23, 2026-11-01); the same jobs passed on 16.0 in February. 26.2
ships the Swift 6.2 line the SwiftPM jobs and the Docker build already use.
…ftObservation)

The ubuntu-latest job links the test bundle against the 6.2.1 toolchain's
libswiftObservation.so and fails with 'undefined reference to
swift::threading::fatal' (PR #23; the same job already failed in February).
The deploy's Docker image is swift:6.2.3-noble and the whole-package tests
link and pass there, so pin CI to the same toolchain.
@foscomputerservices
foscomputerservices merged commit c8f7dbc into main Nov 1, 2026
5 checks passed
@foscomputerservices
foscomputerservices deleted the fix/compose-restart-policy branch November 1, 2026 21:06
foscomputerservices added a commit that referenced this pull request Nov 1, 2026
…s-latest)

The macos-latest runner image now carries Xcode 26.0 through 26.6 only, so
maxim-lobanov/setup-xcode fails before checkout on the iOS, tvOS and watchOS
jobs (PR #23, 2026-11-01); the same jobs passed on 16.0 in February. 26.2
ships the Swift 6.2 line the SwiftPM jobs and the Docker build already use.
foscomputerservices added a commit that referenced this pull request Nov 1, 2026
…ftObservation)

The ubuntu-latest job links the test bundle against the 6.2.1 toolchain's
libswiftObservation.so and fails with 'undefined reference to
swift::threading::fatal' (PR #23; the same job already failed in February).
The deploy's Docker image is swift:6.2.3-noble and the whole-package tests
link and pass there, so pin CI to the same toolchain.
foscomputerservices added a commit that referenced this pull request Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant